<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>Insert title here</title>
<script type="text/javascript" src="js/jquery/jquery-1.7.1.min.js"></script>
</head>
<body>
 <form  id="fileForm" method="POST" enctype="multipart/form-data">
 	账号:<input type="text" id="account" /><br>
 	密码:<input type="text" id="pwd" /><br>
    name:<input type="text" id="name"  /><br>
 	图片：<input type="file" id="fileRed" name="fileRed" /><br>
 	图片：<input type="file" id="fileRed2" name="fileRed" /><br>
 	图片：<input type="file" id="fileRed3" name="fileRed" /><br>
    <input type="button" id="submitForm" value="提交">
 </form>
 <div id="fileView"></div>


<script type="text/javascript">
$("#submitForm").bind("click",function(){
	var formFile = new FormData();	
	var file1 = $("#fileRed").get(0).files[0]; // 文件流
	var file2 = $("#fileRed2").get(0).files[0]; //文件流
	var file3 = $("#fileRed3").get(0).files[0]; //文件流
	formFile.append("mater_obj_1",file1);
	formFile.append("mater_obj_2",file2);
	formFile.append("mater_obj_3",file3);
    
	formFile.append("screen_plan_name","网易云开发者大会");
	formFile.append("ad_desc","为即将召开的网易云大会进行宣传");
	formFile.append("start_time","2018-06-11 12:30:00");
	formFile.append("end_time","2018-06-21 12:30:00");
	formFile.append("screen_id","abc120033");
	formFile.append("mater_type_1","1");
	formFile.append("mater_type_2","1");
	formFile.append("mater_type_3","1");
    $.ajax({  
		url:"./colScre/screen",                
		dataType: "json",
		async: false,
		cache: false,
		processData: false,
		contentType: false,
		data:formFile,  
		type:"POST",
		success : function(result) {  
			alert(result);
		},  
		error : function(XMLHttpRequest, textStatus, errorThrown) {
			if (textStatus == 'timeout') {
				console.log(textStatus);
			}
		}
	});
	
});

</script>
</body>

</html>
